home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / chkasync.doc < prev    next >
Text File  |  1987-07-15  |  1KB  |  46 lines

  1.  
  2.  
  3.         NAME
  4.                 chkdcd -- check state of carrier detect flag
  5.                 chkdsr -- check state of data set ready flag
  6.                 chkcts -- check state of clear to send flag
  7.                 chkring -- check state of ring indicator flag
  8.  
  9.         SYNOPSIS
  10.                 r = chkdcd(port);
  11.                 r = chkdsr(port);
  12.                 r = chkcts(port);
  13.                 r = chkring(port);
  14.                 int r;           TRUE or FALSE, depending upon state
  15.                 int port;        0, 1, 2, or 3 (for COM1-COM4)
  16.  
  17.  
  18.         DESCRIPTION
  19.         These are assembly language functions which provide direct
  20.         access to the serial communications chips for the fastest
  21.         access possible.  Each function checks a particular
  22.         communications flag and returns its state as TRUE (on) or
  23.         FALSE (off).
  24.         The port parameter may be specified as integers 0-3, or
  25.         SER1 to SER4 as defined in <smdefs.h>.
  26.  
  27.  
  28.  
  29.         EXAMPLE
  30.  
  31.             int sport;        /* serial port */
  32.  
  33.             sport = SER2;     /* let it point to COM2 */
  34.             if(chkdcd(sport)) puts("We have a carrier detected");
  35.             else puts("The modem is apparently idle");
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.         This function is found in SMDLx.LIB for the Datalight Compiler
  46.